package com.imooc.service;

import java.util.List;

import com.imooc.bean.Message;
import com.imooc.dao.MessageDao;
import com.imooc.util.Iconst;

public class QueryService {
	
	public String queryByCommand(String command) {
		MessageDao messageDao = new MessageDao();
		
		List<Message> messages = messageDao.queryMessageListMybiatis(command, null);
		if (messages.size() > 0) {
			return messages.get(0).getContent();
		}
		
		return Iconst.NO_MATCHING_CONTENT;
	}

}
